<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function getMax(arr) {
            if (arr[1] > arr[0]) {
                arr[0] = arr[1];
            }
            console.log(arr);
            return arr[0] > arr[2] ? arr[0] : arr[2];
        
        }
        var arr1 = [];
        for (i = 0; i < 3; i++) {
            arr1[i] = +prompt(`请输入第${i + 1}个数：`);
        }
        var max = getMax(arr1);
        alert(`最大值是:${max}`)
    </script>
</head>

<body>

</body>

</html>